package com.mezz.bones.framework.core.strategy.demo;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author: zhuang
 * @Date: 2024/8/12 13:55
 * @Description: TODO
 * @Version: 1.0
 **/
@Slf4j
public abstract class AbstractFileUploadStrategyImpl implements FileUploadStrategy {
    @Override
    public String tag() {
        return null;
    }

    @Override
    public String upload() {

        log.info("开始上传");

        //开始上传
        uploadFile();

        log.info("结束上传");

        return "success";
    }

    protected abstract void uploadFile();


    public static void main(String[] args) {
        //客户端使用 引入strategyContext上下文 然后指定要获取的策略接口跟策略符
//        FileUploadStrategy tx = strategyContext.getStrategy(FileUploadStrategy.class, "tx");
//        tx.upload();
    }
}
